package cz.gelion.shylock.invoice.data

import scala.slick.driver.PostgresDriver.simple._
import java.util.Calendar
import java.util.Date
import java.sql.Timestamp
import scala.beans.BeanProperty


case class SubjectUnit(
    @BeanProperty		id:Int,
 //   @BeanProperty		subject:Subject,
    @BeanProperty		name:String,
    @BeanProperty		note:String
   
  ) 
  

object SubjectUnits extends Table[(SubjectUnit)](Some("invoice"), "subject_unit") {

  def id = column[Int]("id", O.PrimaryKey)
  def name = column[String]("name")
  def note = column[Option[String]]("note")
  def subject = column[Int]("subject")
  def subjectFk = foreignKey("subject_fk", subject, Subjects)(_.id)
  
  def * = id  ~ name ~ note.get <> (SubjectUnit, SubjectUnit.unapply _)
  
}